<?php
ob_implicit_flush();
include "../Lib/Include.php";
$Domain=$_GET["S"];

$Whois=trim(GetWhois(str_replace("www.","",$Domain)));
$Whois=str_replace("\"","",$Whois);
$Whois=str_replace("'","",$Whois);
echo $Whois;


//获取详细Whois信息
function GetWhois($url){
	$fp = fsockopen("whois.ename.net", 80, $errno, $errstr, 30);
	if(!$fp){
		echo "$errstr ($errno)<br />\n";
	}else{
		$out = "GET /".$url."_whois.dns.com.cn HTTP/1.1\r\n" ;
		$out .= "Host: whois.ename.net\r\n" ;
		$out .= "Connection: Close\r\n\r\n" ; 
		fwrite($fp, $out);
		$data="";
		while (!feof($fp)) {
			$data.= fgets($fp, 128);
		}
		fclose($fp); 
		$Arr=spliti("<td style=\"border-bottom:1px dashed #C2DBF0;height:30px;width:615px;\">",$data);
		$Arr=spliti("</td></tr>",$Arr[1]);
		if($Arr[0]!="")
			return $Arr[0];
		else
			return "-";
	}
}

?>